<?php


function AuthInstall($pdio) {
	
        $create_tables = array();
        $db_pref = DB_PREF;
        
        $create_tables[] = <<<SQL
CREATE TABLE IF NOT EXISTS `{$db_pref}profiles` (
  `name` varchar(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
SQL;
        
        $create_tables[] = <<<SQL
CREATE TABLE IF NOT EXISTS `{$db_pref}profiles_ext` (
  `name` varchar(32) NOT NULL,
  `extends` varchar(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
SQL;
        
        $create_tables[] = <<<SQL
CREATE TABLE IF NOT EXISTS `{$db_pref}user` (
  `uname` varchar(32) NOT NULL,
  `hpwd` varchar(255) NOT NULL,
  `salt` varchar(255) NOT NULL,
  `token` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`app_id`,`username`),
  UNIQUE KEY `username_UNIQUE` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
SQL;
        
        $create_tables[] = <<<SQL
CREATE TABLE IF NOT EXISTS `{$db_pref}user_profile` (
  `uname` varchar(64) NOT NULL,
  `profile` varchar(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
SQL;
	
}

function AuthUninstall($pdio) {




}